﻿/*
   Open Intel 
   Copyright © 2011 – ISC. All Rights Reserved.
*/

using Caliburn.Micro;

namespace OIManager.ViewModels
{
    public class AddCategoryViewModel : Screen
    {
        public string Name { get; set; }
        public System.Action<string> OkAction { get; private set; }

        public AddCategoryViewModel(System.Action<string> okAction)
        {
            OkAction = okAction;
            base.DisplayName = "Add a new category:";
        }


        public void Ok()
        {
            TryClose();

            if (OkAction != null)
            {
                OkAction(Name);
            }
        }


        public void Cancel()
        {
            TryClose();
        }
    }
}